CentOS 7
Sponsored Link

PXE Boot : Kickstart Install
2015/06/26
 
It's possible to automate installation work by Kickstart. It's useful when you have to install many computers.
[1]
[2] Configure Kickstart settings.
# generate encrypted root password (remeber it)

[root@dlp ~]#
python -c 'import crypt,getpass; \
print(crypt.crypt(getpass.getpass(), \
crypt.mksalt(crypt.METHOD_SHA512)))'
Password:
$6$EC1T.oKN5f3seb20$y1WlMQ7Ih424OwOn.....
[root@dlp ~]#
mkdir /var/www/html/ks

[root@dlp ~]#
vi /var/www/html/ks/centos7-ks.cfg
# create new

install
# automatically proceed for each steps

autostep
# reboot after installing

reboot
# encrypt algorithm

auth --enableshadow --passalgo=sha512
# installation source

url --url=http://10.0.0.30/centos7/
# install disk

ignoredisk --only-use=sda
# keyboard layouts

keyboard --vckeymap=jp106 --xlayouts='jp','us'
# system locale

lang en_US.UTF-8
# network settings

network --bootproto=dhcp --ipv6=auto --activate --hostname=localhost
# root password you generated above

rootpw --iscrypted $6$EC1T.oKN5f3seb20$y1WlMQ7Ih424OwOn.....
# timezone

timezone Asia/Tokyo --isUtc --nontp
# bootloader's settings

bootloader --location=mbr --boot-drive=sda
# initialize all partition tables

zerombr
clearpart --all --initlabel
# partitioning

part /boot --fstype="xfs" --ondisk=sda --size=500
part pv.10 --fstype="lvmpv" --ondisk=sda --size=51200
volgroup VolGroup --pesize=4096 pv.10
logvol / --fstype="xfs" --size=20480 --name=root --vgname=VolGroup
logvol swap --fstype="swap" --size=4096 --name=swap --vgname=VolGroup
%packages
@core
%end
[root@dlp ~]#
chmod 644 /var/www/html/ks/centos7-ks.cfg

[root@dlp ~]#
vi /var/lib/tftpboot/pxelinux.cfg/default
timeout 100
default menu.c32
menu title ########## PXE Boot Menu ##########
label 1
   menu label ^1) Install CentOS 7
   kernel centos7/vmlinuz
  
# change: specify Kickstart file

   append initrd=centos7/initrd.img
ks=http://10.0.0.30/ks/centos7-ks.cfg
label 2
   menu label ^2) Boot from local drive
   localboot
[3] Start a computer which is enabled network booting on BIOS settings, then PXE boot menu is shown. After 10 seconds later, installation process starts and will finish and reboot automatically.
 
Tweet